# matplotlib?

#””Level 1 - 210
#””Level 2 - 500
#””Level 3 - 960
#””Level 4 - 1650
#””Level 5 - 2660
#””Level 6 - 4080
#””Level 7 - 5970
#””Level 8 - 8420
#””Level 9 - 11520
#””Level 10 - 15330
#””Level 11 - 19940
#””Level 12 - 25440
#””Level 13 - 31880
#””Level 14 - 39380
#””Level 15 - 48000
#””Level 16 - 57800
#””Level 17 - 68900
#””Level 18 - 81360
#””Level 19 - 95240
#””Level 20 - 110660
#””Level 21 - 127680
#””Level 22 - 146360
#””Level 23 - 166810
#””Level 24 - 189120
#””Level 25 - 213320
#””Level 26 - 239530
#””Level 27 - 267840
#””Level 28 - 298280
#””Level 29 - 330970

# - 40*x^3 + 600x - 3y = 0 ... x = ? (in terms of y) ? # credit / level ratio
#40*x^3 + 600x = 3y
#x^3 + 15x = 3y/40

# This is the current solution.. it's a polynomial that fits the data better...
# however some of the numbers are still off by 10.. I can't get any more
# accurate with a calculator that only gives 11 digits unfortunately
# I'll keep trying

# Maybe we can try using one of the following, or something similar:
# http://www.morlok.net/ryan/2006/11/01/open-source-matlab-alternatives/
# http://freemat.sourceforge.net/
# http://www.scipy.org/PyLab

# ps your gobby background color is almost too similar to my white background
# so it's hard to notice anything new you pu

#import math
#	
#def calculate_points(x):
#	'''calculate points based on level'''
#	
#	a = 13.33326203	
#	b = -.008709310612
#	c = 199.9850465
#	d = -3.292913957
#	
#	points = ( ((a)*(x ** 3)) + ((b)*(x ** 2)) + ((c)*x) + d)
#	return int(round((round(points)/10))*10)
#
#for x in range(1,30): print calculate_points(x)

# ps xrange() is a faster generator than range() but not easily explorable

# produces the following output:
# I will indicate the anomalies that are all off by 10.
# The reason for this is the equation is not precise enough for these values
# if you run the code in a script and don't cast to an int you can see
# some need to be floored or raised - unfortunately I can't see any patterns
# A possible solution is to use a dictionary of exp 1-29 and then the equation
# above to extrapolate

# Hm, maybe mess around with math.ceil and math.floor ?
